System

Used to determine if a script is running in a design that is being emulated or on a core.

Properties

Name

Attributes

Comment

.IsEmulating

Read Only

Example

if System.IsEmulating then print("System is Emulating!!") end

Timer (Script v2)

The Timer object is used to create delays or trigger events after a defined elapsed time.  It should be used instead of Lua’s native delay and time functions. There is no limit to the number of timers you create within a single script (within reason). Each Timer must be named when created which is then the means by which you manipulate each specific timer. The Timer:Start method is used to start the timer and set the delay time.  When the delay time has elapsed, the function specified in Timer.EventHandler is called. By default, Timer repeats when it has elapsed. Timer.Stop is used to stop the timer. Each Control Script has a single Timer.

Properties

Name

Attribute

Comment

Timer.New()

Creates a new timer object

 

Properties

Name

Attribute

Comment

.EventHandler

 

Methods

Name

Arguments

Comment

:Start

( period in seconds)

Starts the timer

:Stop

none

Stops the timer

Example

timer1 = Timer.New()

timer2 = Timer.New()

 

function timerFunc(timer)

if timer == timer1 then

print( "timer 1!" )

elseif timer == timer2 then

print ( "timer 2" )

end

end

timer1.EventHandler = timerFunc

timer2.EventHandler = timerFunc

 

timer1:Start(1)

timer2:Start(2)


 

© 2009 - 2016 QSC, LLC. All rights reserved. QSC and the QSC logo are trademarks of QSC, LLC in the U.S. Patent and Trademark office and other countries. All other trademarks are the property of their respective owners.

http://patents.qsc.com.